﻿// --------------------------------
// <copyright file="ModelTests.cs" company="OpenTicket">
//     Microsoft Public License (Ms-PL)
// </copyright>
// <author>Glenn</author>
// ---------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenTicket.Model;
using OpenTicket.Services;

namespace OpenTicket.Tests
{
    /// <summary>
    /// Tests for the OpenTicket model
    /// </summary>
    [TestClass]
    public class ModelTests:BaseTest
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ModelTests"/> class.
        /// </summary>
        public ModelTests()
        {
        }

        /// <summary>
        /// The testcontext
        /// </summary>
        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }

            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        //
        // You can use the following additional attributes as you write your tests:
        //
        // Use ClassInitialize to run code before running the first test in the class
        // [ClassInitialize()]
        // public static void MyClassInitialize(TestContext testContext) { }
        //
        // Use ClassCleanup to run code after all tests in a class have run
        // [ClassCleanup()]
        // public static void MyClassCleanup() { }
        //
        // Use TestInitialize to run code before running each test 
        // [TestInitialize()]
        // public void MyTestInitialize() { }
        //
        // Use TestCleanup to run code after each test has run
        // [TestCleanup()]
        // public void MyTestCleanup() { }
        //
        #endregion

        /// <summary>
        /// Test for order
        /// </summary>
        [TestMethod]
        public void OpenTicketHasAnEntityOrder()
        {
            var o = new Model.Order();
            o.OrderId = new Guid();
            o.CreatedDate = new DateTime();
            o.Client = new Model.Client();
            o.OrderRows = new List<OrderRow>();               
        }

        /// <summary>
        /// Test for OrderRow
        /// </summary>
        [TestMethod]
        public void OpenTicketHasAnEntityOrderRow()
        {
            var o = new Model.OrderRow();
            o.OrderId = new Guid();
            o.Amount = 1;
            o.Product = new Model.Product();           
        }

        /// <summary>
        /// Test for Client
        /// </summary>
        [TestMethod]
        public void OpenTicketHasAnEntityClient()
        {
            Client c = new Client();
            c.ClientId = 1;
            c.FirstName = "Test";
            c.LastName = "Test";
        }

        /// <summary>
        /// Test for Product
        /// </summary>
        [TestMethod]
        public void OpenTicketHasAnEntityProduct()
        {
            var p = new Model.Product();
            p.ProductCode = "AFK-123";
            p.ProductName = "TestProduct";
            p.ProductCost = 50000;
        }
    }
}
